package com.gui.spring.ioc.bean;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

public class GetBeanDemo1 {


    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
        System.out.println("=====================================");

        for (String name :context.getBeanDefinitionNames()){
            System.out.println(name);
        }

//        Object bean = context.getBean("getBeanDemo1.Bean1");
    }


    @Component
    static class Bean1{

    }

    @ComponentScan("com.gui.spring.ioc.bean")
    static class Config{

    }

}
